/**
 * Created by WLG on 2018/11/9.
 */
let serverConfig = require('../config/serverConfig');
class   BaseService {
    /**
     * 根据socketId 发送消息
     * @param io
     * @param socketId
     * @param eventName
     * @param msg
     */
    static emitMsg(io,socketId,eventName,msg){
        let targetSocket = io.of(serverConfig.socketNameSpace).sockets[socketId];
        if(targetSocket){
            targetSocket.emit(eventName,msg);
        }
    }
}
module["exports"] = BaseService;